<template>
  <el-upload
    class="image-item"
    :action="uploadUrl"
    :show-file-list="false"
    :on-success="handleSuccess"
  >
    <i class="el-icon-folder-opened"></i>
  </el-upload>
</template>
<script>
import envConfig from "@/config/env.config.js";
export default {
  computed: {
    uploadUrl() {
      return envConfig.baseUrl + "/file/upload";
    },
  },
  methods: {
    handleSuccess(res) {
      this.$emit("uploadSuccess", envConfig.baseUrl + res.message);
    },
  },
};
</script>